-- GENERATED SPELL FOR [Somnus] --


function spell0_12900(pUnit, Event) --@Corrosive Acid Breath,n/a--
pUnit:FullCastSpellOnTarget(20667,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12900', 30000, 1)
end

function spell1_12900(pUnit, Event) --@Sleep,n/a--
pUnit:FullCastSpellOnTarget(20989,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12900', 10270, 1)
end

function spell2_12900(pUnit, Event) --@Strike,n/a--
pUnit:FullCastSpellOnTarget(18368,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12900', 558, 1)
end

function spell3_12900(pUnit, Event) --@Wing Flap,Self--
pUnit:FullCastSpellOnTarget(12882,pUnit)
pUnit:RegisterEvent('Sorts_12900', 583, 1)
end

function Sorts_12900(pUnit, Event)
local choix_sorts_12900 = math.random(0, 3)
if choix_sorts_12900 == 0 then
pUnit:RegisterEvent('spell0_12900', 1, 1)
end
if choix_sorts_12900 == 1 then
pUnit:RegisterEvent('spell1_12900', 1, 1)
end
if choix_sorts_12900 == 2 then
pUnit:RegisterEvent('spell2_12900', 1, 1)
end
if choix_sorts_12900 == 3 then
pUnit:RegisterEvent('spell3_12900', 1, 1)
end
end

function mob12900_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_12900', math.random(1500, 3000), 1)
end

function mob12900_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12900_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12900_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(12900, 1, 'mob12900_Action')
RegisterUnitEvent(12900, 2, 'mob12900_Leave')
RegisterUnitEvent(12900, 3, 'mob12900_Kill')
RegisterUnitEvent(12900, 4, 'mob12900_Die')
